﻿<?xml version="1.0" encoding="utf-8"?>
<data>
  <DbCache id="1" />
  <!-- This files is intended as the ADO.NET cache 'Cleaner
    In cases, that ADO.NET is used for accessing the Stored Procedures, 
    .NET built in caching mechanism is usually not working
    
    for this reasons, extend the EntityDao with the FileDependency caching, 
    which will target this file:
    
    
    1) Then append in for instance in the Find:
            ...    
            TheList = this.Cache()[key] as IList<ENTITY>;
            if (TheList.IsNull())
            {        
                if (!ExecuteReaderToList())
                {
                    return null; // Reader was not executed succesfully
                }
                this.Cache().Insert(key, TheList
                        , DbCache.Dependency
                        , DateTime.UtcNow.AddSeconds(20)
                        , System.Web.Caching.Cache.NoSlidingExpiration);
            }
            ...
            
    Where "DbCache.Dependency" will create connection to this file
    
    2) The DB Session handler:
     
     ProjectBase.Data.Db.DbSession
     
     will then on Commit() clear the cache for you 
     
        public static void TransactionCommit()
        {
            ...
            DbCache.Clear();            
        }
     
     That all is in the WEB application triggered using the [TransactionAttribute]
     
    3) and as usuall - adjust it to your needs
     
   -->
</data>